package review;

import java.util.Scanner;

public class DelArray {

	public static void main(String[] args) {
		String[] ar = { "桃子", "梨子", "西瓜", "李子", "葡萄", "菠萝" };

		Scanner in = new Scanner(System.in);
		System.out.println("输入数字");
		int a = in.nextInt() - 1;// 从1开始

		if (a >= 0 && a < ar.length) {
			for (int i = a; i < ar.length - 1; i++) {
				ar[i] = ar[i + 1];
				ar[i + 1] = null;
			}

			// for (int i = a; i < ar.length - 1; i++) {
			// ar[i] = ar[i + 1];
			// }
			// ar[ar.length - 1] = null;
		}
		for (int c = 0; c < ar.length; c++) {
			System.out.print(ar[c] + " ");
		}
	}
}
